<template>
	<view>
		<head-navigation :back-is-show="1" :title="title" :txtColor="txtColor" :is-back="1" :background-color="'#fff'"></head-navigation>
		<view class="main">
			<rich-text :nodes="$queue.repairRichText(nodes)"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '1', //1:用户服务协议，2：用户隐私协议
				nodes:'',//富文本内容
				title:''
			}
		},
		onLoad(option) {
			console.log(option)
			this.type = option.type
			if (this.type == '1') {
				uni.setNavigationBarTitle({
					title: '用户服务协议'
				})
				this.title =  '用户服务协议'
			} else if (this.type == '5') {
				uni.setNavigationBarTitle({
					title: '会员授权协议'
				})
				this.title =  '会员授权协议'
			} else if (this.type == '6') {
				uni.setNavigationBarTitle({
					title: '入会须知'
				})
				this.title = '入会须知'
			}else if (this.type == '7') {
				uni.setNavigationBarTitle({
					title: '用户注销协议'
				})
				this.title = '用户注销协议'
			}
            else {
				uni.setNavigationBarTitle({
					title: '隐私政策'
				})
				this.title = '隐私政策'
			}
			this.getInfo()
		},
		methods: {
			// 获取协议信息
			async getInfo() {
				var res = await this.$api.getCustomerAgreementDetail(this.type)
				this.nodes = res.result.agreement
			},
		}
	}
</script>

<style>
	.main {
		padding: 20rpx 40rpx 100rpx;
	}

	.title {
		width: 100%;
		font-size: 32rpx;
		font-weight: bold;
		color: #000;
		text-align: center;
	}

	.title_one {
		font-size: 30rpx;
		font-weight: bold;
		color: #000;
		margin-bottom: 20rpx;
		margin-top: 20rpx;
	}
	.title_tow{
		width: 100%;
		font-size: 24rpx;
		color: #000;
		text-align: center;
		margin-bottom: 20rpx;
	}
	.content {
		font-size: 28rpx;
		color: #444;
		line-height: 50rpx;
		text-align: justify;
	}

	.fontWeight {
		font-weight: bold;
	}
</style>
